package com.skivingcloud.develop.entity;

import com.fasterxml.jackson.databind.JsonNode;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

import java.io.Serializable;
import java.util.List;

/**
 * 应用设计记录 实体类。
 *
 * @author skivingcloud
 * @since 2024-01-18
 */
@Schema(description = "应用设计记录")
@Table(value = "sys_business_designer")
public class SysBusinessDesigner implements Serializable {

    /**
     * 主键
     */
    @Id
    @Schema(description = "主键")
    private String id;

    /**
     * 版本
     */
    @Schema(description = "版本")
    private Long version;

    /**
     * 应用设计编码
     */
    @NotBlank(message = "应用设计编码不能为空")
    @Size(max = 255, message = "应用设计编码长度不能超过255")
    @Schema(description = "应用设计编码")
    private String designerCode;

    /**
     * 应用设计名称
     */
    @NotBlank(message = "应用设计名称不能为空")
    @Size(max = 255, message = "应用设计名称长度不能超过255")
    @Schema(description = "应用设计名称")
    private String designerName;

    /**
     * 业务类型：sys_business_type.type_code
     */
    @NotBlank(message = "业务类型不能为空")
    @Size(max = 50, message = "业务类型长度不能超过50")
    @Schema(description = "业务类型：sys_business_type.type_code")
    private String typeCode;

    /**
     * 是否含流程
     */
    @NotBlank(message = "是否含流程不能为空")
    @Size(max = 6, message = "是否含流程长度不能超过6")
    @Schema(description = "是否含流程")
    private String hasTask;

    /**
     * 流程定义编码
     */
    @Size(max = 255, message = "流程定义编码长度不能超过255")
    @Schema(description = "流程定义编码")
    private String taskDefCode;

    /**
     * 新建时表单
     */
    @Schema(description = "新建时表单")
    private String newFormId;

    /**
     * 修改时表单
     */
    @Schema(description = "修改时表单")
    private String modFormId;

    /**
     * 详情表单
     */
    @Schema(description = "详情表单")
    private String detailFormId;

    /**
     * 菜单路径
     */
    @Size(max = 255, message = "菜单路径长度不能超过255")
    @Schema(description = "菜单路径")
    private String menuTxt;

    /**
     * 是否自定义接口
     */
    @NotBlank(message = "是否自定义接口不能为空")
    @Size(max = 6, message = "是否自定义接口长度不能超过6")
    @Schema(description = "是否自定义接口")
    private String customizeApi;

    /**
     * 新增接口url
     */
    @Size(max = 500, message = "新增接口url长度不能超过500")
    @Schema(description = "新增接口url")
    private String addApiUrl;

    /**
     * 修改接口url
     */
    @Size(max = 500, message = "修改接口url长度不能超过500")
    @Schema(description = "修改接口url")
    private String updateApiUrl;

    /**
     * 表单数据加载接口
     */
    @Size(max = 500, message = "表单数据加载接口长度不能超过500")
    @Schema(description = "表单数据加载接口")
    private String detailApiUrl;

    /**
     * 是否已发布：0-否、1-是
     */
    @Schema(description = "是否已发布")
    private String resStatus;

    /**
     * 页面类型：1-管理页、2-表单页
     */
    @NotBlank(message = "页面类型不能为空")
    @Size(max = 6, message = "页面类型长度不能超过6")
    @Schema(description = "页面类型：1-管理页、2-表单页")
    private String pageType;

    /**
     * 新增时表单数据
     */
    @Column(ignore = true)
    private String newFormJson;
    
    /**
     * 修改时表单数据
     */
    @Column(ignore = true)
    private String modFormJson;

    /**
     * 详情时表单数据
     */
    @Column(ignore = true)
    private String detailFormJson;

    /**
     * 表单数据结构对象
     */
    @Column(ignore = true)
    private JsonNode formDataSchema;

    /**
     * 表单下组件信息
     */
    @Column(ignore = true)
    private List<SysBusinessDesignerComponent> componentList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public String getDesignerCode() {
        return designerCode;
    }

    public void setDesignerCode(String designerCode) {
        this.designerCode = designerCode;
    }

    public String getDesignerName() {
        return designerName;
    }

    public void setDesignerName(String designerName) {
        this.designerName = designerName;
    }

    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }

    public String getHasTask() {
        return hasTask;
    }

    public void setHasTask(String hasTask) {
        this.hasTask = hasTask;
    }

    public String getTaskDefCode() {
        return taskDefCode;
    }

    public void setTaskDefCode(String taskDefCode) {
        this.taskDefCode = taskDefCode;
    }

    public String getNewFormId() {
        return newFormId;
    }

    public void setNewFormId(String newFormId) {
        this.newFormId = newFormId;
    }

    public String getModFormId() {
        return modFormId;
    }

    public void setModFormId(String modFormId) {
        this.modFormId = modFormId;
    }

    public String getDetailFormId() {
        return detailFormId;
    }

    public void setDetailFormId(String detailFormId) {
        this.detailFormId = detailFormId;
    }

    public String getMenuTxt() {
        return menuTxt;
    }

    public void setMenuTxt(String menuTxt) {
        this.menuTxt = menuTxt;
    }

    public String getCustomizeApi() {
        return customizeApi;
    }

    public void setCustomizeApi(String customizeApi) {
        this.customizeApi = customizeApi;
    }

    public String getAddApiUrl() {
        return addApiUrl;
    }

    public void setAddApiUrl(String addApiUrl) {
        this.addApiUrl = addApiUrl;
    }

    public String getUpdateApiUrl() {
        return updateApiUrl;
    }

    public void setUpdateApiUrl(String updateApiUrl) {
        this.updateApiUrl = updateApiUrl;
    }

    public String getDetailApiUrl() {
        return detailApiUrl;
    }

    public void setDetailApiUrl(String detailApiUrl) {
        this.detailApiUrl = detailApiUrl;
    }

    public String getResStatus() {
        return resStatus;
    }

    public void setResStatus(String resStatus) {
        this.resStatus = resStatus;
    }

    public String getPageType() {
        return pageType;
    }

    public void setPageType(String pageType) {
        this.pageType = pageType;
    }

    public String getNewFormJson(){
        return newFormJson;
    }
    
    public void setNewFormJson(String newFormJson){
        this.newFormJson = newFormJson;
    }
    
    public String getModFormJson(){
        return modFormJson;
    }
    
    public void setModFormJson(String modFormJson){
        this.modFormJson = modFormJson;
    }
    
    public String getDetailFormJson(){
        return detailFormJson;
    }
    
    public void setDetailFormJson(String detailFormJson){
        this.detailFormJson = detailFormJson;
    }

    public JsonNode getFormDataSchema() {
        return formDataSchema;
    }

    public void setFormDataSchema(JsonNode formDataSchema) {
        this.formDataSchema = formDataSchema;
    }

    public List<SysBusinessDesignerComponent> getComponentList() {
        return componentList;
    }

    public void setComponentList(List<SysBusinessDesignerComponent> componentList) {
        this.componentList = componentList;
    }
}
